<?php

$dbHost = '69.162.127.42';
$dbUsername = 'chatdb';
$dbPassword = '@Chat12345';
$dbName = 'chatdb';
$con=mysql_connect($dbHost,$dbUsername,$dbPassword) or die("could not connect");
mysql_select_db($dbName);
$ravi="feewee";
$ghgh=getfrined($ravi);
echo $ghgh;
$data='{"Conteact":[{"Mobile":"+918127297396","Name":"Ravi"},{"Mobile":"+918127297395","Name":"Shyam"},{"Mobile":"+918127297397","Name":"Jdaas"},{"Mobile":"+918127297398","Name":"Dabbu"},{"Mobile":"+918127297399","Name":"Android"}]}';
$assoc = false;
$frt=json_decode($data,$assoc);
//var_dump($frt);
	foreach($frt->Conteact as $record)
	{
		 $mobile=$record->Mobile;
		 $name=$record->Name;
		 print($mobile);
		$sql="insert into user_contact(mobile) values('".$mobile."')";
			if($result=mysql_query($sql))
			{
             
              print("insert");
			}
			else
			{
				print("ededee");

			}
		 
	}

function getfrined($ravi)
{
	return $ravi;
	
	}
?>